This program is adapted from the mc.c source provided by Mike Chupa

/* mc.c Marching Cubes implementation for lab1
   Mike Chupa
   CS 8413: Visualization
   Instructor: Dr. Raghu Machiraju
   Copyright (c) 1998 Michael A. Chupa Permission is expressly granted
   to use this code in any non-commercial work, provided that this
   notice is preserved. However, be aware that the Marching Cubes
   algorithm is patented.
*/

I have nothing to add to this and you may distribute this code freely
in accordance with the above.

The program is run by entering, for example,

  mc big_wobbly_thing.df3 73.4

After much diagnostic output you will have a file called
big_wobbly_thing.inc which contains a POVRay mesh2 definition
with normals but no UV map.  The mesh is the isosurface with
value 73.4 taken from the density map.  This threshold
value must lie between 0.0 and 255.0 to get any triangles.

The output can be used in the following way:

object
{
  #include "big_wobbly_thing.inc"

  texture { Blah }
  rotate 90 * z
}

Note that the output file name is generated by replacing the last
3 characters of the input file name with "inc"; nothing more
sophisticated.  This is a slight improvement on the original
which simply concatenated ".vi" onto the end of argv[1], 
twice if the file couldn't be opened!

(This actually worked *before* I changed it)

Please also note that this program was hacked together as a
means to and end and is untested and probably broken.


Have fun,

Andy


